package util;

import java.sql.Connection;
import java.sql.DriverManager;


public class ConnManager {
	//数据库5大参数
	private static final String IP = "127.0.0.1";
	private static final String POST = "3306";
	private static final String DATABASE_NAME = "cinema";
	private static final String USER_NAME = "root";
	private static final String PASSWORD = "123456";
	private static final String DRIVER = "org.gjt.mm.mysql.Driver";
	public static Connection getConnection() throws Exception{
		String url = "jdbc:mysql://"+IP+":"+POST+"/"+DATABASE_NAME+"?user="+USER_NAME+"&password="+PASSWORD+"";
		Class.forName(DRIVER);
		Connection conn = DriverManager.getConnection(url);
		return conn;
	}
}
